package cn._2dland.http.method.multiparts;

/**
 * 数据块
 * 
 * @author deadblue
 */
abstract public class Part {
	public static final String CRLF = "\r\n";

	/** 分段名称 */
	protected String name = null;

	/** 分段字符集，缺省使用utf-8 */
	protected String charset = null;

	public Part(String name) {
		this.name = name;
		this.charset = "UTF-8";
	}

	public Part(String name, String charset) {
		this.name = name;
		this.charset = charset;
	}

	/**
	 * 设置数据块的字符集
	 * @param charset
	 */
	public void setCharset(String charset) {
		this.charset = charset;
	}

	abstract public byte[] getBytes();
}
